<template>
  <div class="container">
    <div class="header">
      <div class="left">
        <nuxt-link to="/"></nuxt-link>
        <span>&nbsp;·&nbsp;</span>
        <span>个人中心</span>
      </div>
      <div class="right">
        <avatar></avatar>
      </div>
    </div>
    <div class="main">
      <div class="nuxt-wrap">
        <nuxt />
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      isPlus: false,
      isShow: false
    }
  },
  computed: {
    activeIndex () {
      const pathsFirst = ['xuanke', 'xuanke-holland ', 'xuanke-report']
      if (pathsFirst.indexOf(this.$route.name) > -1) {
        return 0
      }
      const pathSecond = ['xuanke-by-profession']
      if (pathSecond.indexOf(this.$route.name) > -1) {
        return 1
      }
      const pathThird = ['xuanke-by-subject']
      if (pathThird.indexOf(this.$route.name) > -1) {
        return 2
      }
      const pathfouth = ['xuanke-search', 'xuanke-profession-details']
      if (pathfouth.indexOf(this.$route.name) > -1) {
        return 3
      }
      switch (this.$route.query.fromPage) {
        case 'report':
          return 0
        case 'by-profession':
          return 1
        case 'by-subject':
          return 2
        case 'search':
          return 3
        default:
          return 4
      }
    }
  }
  // mounted () {
  //   window.onresize = function () {
  //     if (document.documentElement.clientWidth > 1300) {
  //       this.isPlus = true
  //     } else {
  //       this.isPlus = false
  //     }
  //     console.log('屏幕宽度为：' + document.documentElement.clientWidth + this.isPlus)
  //   }
  //   if (document.documentElement.clientWidth > 1300) {
  //     this.isPlus = true
  //   } else {
  //     this.isPlus = false
  //   }
  // }
}
</script>
<style  scoped lang="scss">
@import "@/assets/scss/user-center.scss";
$header_height: 50px;
.container {
  height: 100%;
  overflow: hidden;
  background: $grey;
  display: flex;
  flex-direction: column;
  .header {
    display: flex;
    height: $header_height;
    width: 100%;
    padding: 0 60px;
    background: $light;
    color: $royal-deep;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px 0 $stable;
    .left {
      display: flex;
      align-items: center;
      > a {
        background: url("https://fdwebhost.oss-cn-huhehaote.aliyuncs.com/zhiyazhiyuan/images/logo_user.png") center no-repeat;
        background-size: 100% 100%;
        text-align: left;
        width: 72px;
        height: 25px;
        display: inline-block;
      }
      a,
      span {
        font-size: 22px;
        color: $royal-deep;
        margin-top: -2px;
        // font-weight: 300;
      }
      .icon-logo {
        margin-right: 10px;
      }
    }
    .right {
      position: relative;
      cursor: pointer;
      display: flex;
      align-items: center;
      /* > a {
        color: $royal-deep;
        font-size: 17px;
        padding-right: 10px;
        line-height: 35px;
        &:hover,
        &:focus {
          color: $positive !important;
          text-decoration: none !important;
          background: none !important;
        }
      } */
      /deep/ .avatar {
        li:hover,a:hover {
          color: $royal-deep;
          cursor: pointer;
        }
        .icon {
          color: black;
        }
      }
    }
  }
  .main {
    padding: 50px 60px;
    flex: 1;
    overflow: hidden;
    .nuxt-wrap {
      position: relative;
      padding: 44px 75px;
      background: $light;
      height: 100%;
      overflow-y: auto;
    }
  }
}
</style>
